Method for wear leveling in a nonvolatile memory

ABSTRACT

A method for writing and reading data memory cells, comprising: defining in a first memory zone erasable data pages and programmable data blocks; and, in response to write commands of data, writing data in erased blocks of the first memory zone, and writing, in a second memory zone, metadata structures associated with data pages and comprising, for each data page, a wear counter containing a value representative of the number of times that the page has been erased.

BACKGROUND

1. Technical Field

The present disclosure relates to nonvolatile memories and particularlyelectrically programmable and erasable memories of the FLASH type.

2. Description of the Related Art

The market for electrically programmable and erasable memories onsemiconductor wafers is traditionally divided between EEPROM memoriesand FLASH memories (or FLASH-EEPROM).

EEPROM memories comprise memory cells consisting of one floating gatetransistor and one access transistor. FLASH-type memories comprise onlyone floating gate transistor per memory cell, and have the advantagebeing highly compact as far as the semiconductor surface occupied isconcerned (the number of memory cells per surface unit). On the otherhand, the absence of an access transistor involves the provision ofpositive threshold voltages for both the erased memory cells and theprogrammed memory cells so as to not create short circuits upon the bitlines. The gate oxides are therefore thick in order to durably maintainthe electrical charges trapped in the floating gates, which entails alonger erase time. The erasure of FLASH memory cells is often done bytunnel effect whereas their programming is done by hot electroninjection. The time for writing the memory cells is short, for example 5microseconds, whereas the erase time is long, for example 100milliseconds. Moreover, hot electron injection programming involves ahigh programming current, such that the number of memory cells able tobe simultaneously programmed is generally limited to one byte.

FLASH memories were thus originally dedicated to mass storage. Variousimprovements have since been proposed so that they may offer featurescloser to those of EEPROM memories. Among the improvements that may becited is a page-erasable FLASH memory, such as that described by U.S.Pat. No. 6,807,103, which is hereby incorporated by reference in itsentirety.

These improvements have allowed for the commercialization ofpage-erasable FLASH memories offering the same apparent functionalitiesas those of EEPROM memories, but in which certain limitations remain:

-   -   a long erase time, which may be cumbersome in certain        applications. Indeed, the apparent write time of a byte is        determined by the erase time of the page that will receive the        byte, the page to be completely erased each time a new byte is        to be written within, the other bytes initially present in the        page also to be written within; and    -   a lack of protection against untimely power interruptions during        the erasure of a page or the writing of blocks.

As a result, FLASH memories were initially unable to be used as embeddedmemories in integrated circuits destined for applications where there isa high risk of a power supply interruption, mainly applications for chipcards or electronic tags, in which the power supplied to the integratedcircuit may disappear in the case of a “tearing” (removal of the cardfrom the card reader).

Other improvements to FLASH memories thus aimed to improve the datawrite time and to protect the data from tearing. To this end, data writemethods called “delayed erase” were proposed. According to thesemethods, the writing of data is only done in erased pages and comprisesmemory cell write cycles without associated erase cycles. The successivewriting of data in erased pages reveals invalid data, filling up morememory space than that which is necessary to store the valid data. Asthe memory space diminishes, the invalid data are erased to free upmemory space (delayed erase). It has generally been proposed to use thewrite methods with delayed erase in relation with the protection of dataagainst tearing (“tearing proof programming” or “anti-tearing methods”),because the applications requiring a fast data write are generallyapplications that are sensitive to power supply problems (chip cards).

As an example, the patent application publication No. US2005/0251643describes a method of writing data protected against tearing (“tearingproof programming”, Cf. paragraph 0008) adapted to FLASH memories. Thememory pages are used to store, in addition to the useful data, alogical page address and a counter value. A look-up table allows alogical address to be associated with a physical address (electricaddress). When a data is to be written in a page, the page contents arecopied into a page buffer. The new data is incorporated therein, and thecounter value is incremented. The updated page contents are then writteninto another page, with the same logical address. The initial page isthen erased.

U.S. Patent Application Publication No. US2008/0301357, which isincorporated herein by reference in its entirety describes a method ofwriting data with delayed erase, in which the page erasure is done in“N” steps of partial erasure of short duration, which are applied topages other than those used to write the data. A step of partial erasureis launched after each step of writing of data, such that after N stepsof writing, erased pages are obtained. Then a rotation is performedbetween the erased pages and the pages containing invalid data, theerased pages being used to write new data while the invalid pages arethen submitted to the progressive erasure process. To this end, anauxiliary memory zone comprises a “current” sector comprising erasedauxiliary pages usable to write the data, a “save” sector comprisingauxiliary pages containing data linked to pages to erase or beingerased, a “transfer” sector comprising pages containing data to transferinto the erased pages, and an “unavailable” sector comprising pagesbeing erased.

Additionally, the documents U.S. Patent Application Publication Nos.2008/082736 and 2005/0144357 disclose a memory comprising sectors ofdata and zones of management data, including an erase counter, that areplaced in a sector overhead zone.

In summary, the above methods of delayed erase may handle entire pages.The pages of data are written in pre-erased material pages, theaddresses of which are arbitrary, and a page logical address or “tag”that allows the page to be found is attributed to each page of data.This “tag” is saved with the page data and is “attached” to them, thatis to say concatenated and placed in the same physical page. Anotherfeature of the above methods is that each writing of a data in responseto a write command involves the reading of all the page data, theinsertion of the new data into the page data, then the rewriting of allthe updated page data. As a result, a large “consumption” of erasedpages occurs, in other words a high “cycling” and therefore anaccelerated memory cell wear (the “cycling” representing the number oftimes that a page has been erased).

BRIEF SUMMARY

The present disclosure proposes improvements to methods of writing withdelayed erase.

More particularly, the disclosure relates to a method for writing andreading data in electrically erasable and programmable nonvolatilememory cells, comprising: providing a first nonvolatile memory zone;defining in the first memory zone erasable data pages; defining in thedata pages programmable data blocks; and in response to write commandsof data, writing data in erased blocks of the first memory zone;providing a second nonvolatile memory zone; writing, in the secondmemory zone, metadata structures associated with data pages present inthe first memory zone and comprising, for each data page, a wear countercontaining a value representative of the number of times that the pagehas been erased; and when a data page is erased, incrementing the wearcounter of the erased page in the metadata structure associated with theerased data page.

According to one embodiment, the method comprises the steps consistingof: writing, in each metadata structure associated with a data page, aninformation about the status, valid or invalid, of the page; and erasingthe invalid data pages.

According to one embodiment, the method comprises the steps consistingof: invalidating a metadata structure associated with an erased datapage; attributing a new metadata structure to the erased data page; andwriting in the new metadata structure an incremented value of the wearcounter present in the old metadata structure.

According to one embodiment, the method comprises the steps consistingof: defining in the second memory zone metadata pages; writing themetadata structures associated with the data page in erased fields ofthe metadata pages; and attributing to each metadata page a wear countercontaining a value representative of the number of times that themetadata page has been erased.

According to one embodiment, the method comprises the steps consistingof: arranging the wear counter of a metadata page on the interior of themetadata page; before erasing the metadata page, copying the wearcounter of the metadata page into a metadata structure that is writtenin another metadata page; and after having erased the metadata page,recopying the value of the counter on the interior of the metadata page.

According to one embodiment, the method comprises the steps consistingof: invalidating the metadata structures associated with erased datapages; and erasing a metadata page only comprising invalid metadatastructures.

According to one embodiment, the method comprises the steps consistingof: invalidating a metadata page only comprising invalid metadatastructures; and erasing a metadata page once it is invalid.

According to one embodiment, the method comprises the steps consistingof: before erasing a metadata page, writing in the second memory zone atemporary information structure comprising: a start flag, an address inthe second memory zone of the metadata page to erase, the wear counterof the metadata page, and after having erased the metadata page, readingthe wear counter in the temporary information structure, incrementingthe wear counter, and writing it in the erased metadata page, andwriting a final flag in the temporary information structure.

According to one embodiment, the method comprises steps of dynamic pagewear management consisting of: when a data having a logical address isto be written in a new page of the first memory zone, selecting, fromamong several erased pages of the first memory zone, the page having thelowest wear counter; and writing the data in the selected page.

According to one embodiment, the method comprises steps of dynamic pagewear management consisting of: setting up a list of addresses of eraseddata pages of the first memory zone; classing the addresses of theerased pages by increasing or decreasing order of the values of the wearcounters that they comprise; and when a data is to be written in a newpage of the first memory zone; selecting, from the list of pageaddresses, those that refer to a metadata page comprising a wear counterhaving the lowest value or one of the lowest values; and writing thedata in the selected page.

According to one embodiment, the method comprises a step of static pagewear management consisting of transferring, into a second data page ofthe first memory zone, data present in a first data page, the secondpage having a wear counter with a lower value than that of the wearcounter of the first page.

According to one embodiment, the method comprises a step consisting ofconfiguring the metadata structures associated with data pages in theform of descriptors, a descriptor being associated with a data page andcomprising: a metadata field forming the wear counter; a first fieldcontaining the address of the page in the first memory zone or an indexindicating the position of the page in the first memory zone; a secondfield containing the address of a logical page in a virtual memory or anindex indicating the position of a logical page in a virtual memory; foreach data block of the data page with which the descriptor isassociated, a third field containing an information about the locationof the data block in the data page; an information about the status ofthe block from among the at least three following statuses: erasedblock, block containing a valid data, or block containing an invaliddata; and an information about the position in the logical page of thedata saved in the considered block.

According to one embodiment, the third field is a field of indexedmetadata of which the position in the descriptor designates a data blockof the data page with which the descriptor is associated, and of whichthe contents may have an erased value indicating that the designatedblock is erased, a programmed value indicating that the designated blockcontains an invalid data, or a partially programmed value giving aninformation about the location in the logical page of the data stored inthe designated block.

According to one embodiment, the method comprises a step consisting ofdefining the first and second memory zones within a same nonvolatilememory.

According to one embodiment, the method comprises, in response to a readcommand of a data comprising a logical address, the steps consisting of:finding, in the second memory zone, a metadata structure containing thislogical address and associated with valid data; reading, in the metadatastructure, the address of the data in the first memory zone; and readingthe data in the first memory zone.

Embodiments relate to an integrated circuit comprising a processingunit, at least one nonvolatile memory comprising electrically erasableand programmable memory cells, and the processing unit is configured towrite or read the data in the memory in conformance with the method asdescribed above.

Embodiments relate to a portable object comprising such an integratedcircuit.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Embodiments of systems and methods for writing and reading data will bedescribed in the following with reference to, in a non-limiting manner,the attached drawings in which:

FIG. 1 shows a device equipped with a nonvolatile memory and comprisingmeans for implementing an embodiment of the method,

FIG. 2 shows schematically an arrangement of data and of metadata in thememory of the integrated circuit,

FIG. 3 is a flowchart describing a data write operation in the memory ofthe integrated circuit,

FIGS. 4A to 4E are flowcharts describing example steps of data writingin the memory of the integrated circuit,

FIGS. 5A to 5E show data writing described by the FIGS. 4A to 4E,

FIG. 6 shows a metadata structure of a first type,

FIG. 7 shows a metadata structure of a second type,

FIG. 8 shows schematically a configuration of a look-up table,

FIG. 9 is a schematic representation of various tasks that may beimplemented by the integrated circuit,

FIG. 10 is a flowchart describing initialization tasks performed by theintegrated circuit upon its power on,

FIGS. 11 and 12 are flowcharts respectively describing theimplementation of a data write command and of a data read command in thememory of the integrated circuit, and

FIGS. 13 to 16 are flowcharts describing memory maintenance tasksimplemented by the integrated circuit.

DETAILED DESCRIPTION

The disclosure relates to various improvements to methods of datawriting with delayed erase, particularly applicable to FLASH memories.The disclosure has several aspects that will be described in distinctsections in the following description. It may be noted that thedisclosure is not limited to a combination of these aspects, but ratherrelates to each aspect as it may be considered independently of theother aspects. Therefore, in the following, phrases such as “accordingto the disclosure” or “according to an aspect of the disclosure” mayrelate to embodiments implementing only one of these aspects, some ofthese aspects, or all of these aspects at the same time, and do notsignify that all the embodiments comprise the described feature.

It will be considered in the following, by convention, that the logic“1” represents the value of a data present in an erased memory cell, or“erased logic value”. Consequently, the logic “0” represents the valueof a data present in a programmed memory cell, or “programmed logicvalue”. Furthermore, the data are shown in hexadecimal notation, thevalue of an erased byte therefore being “FF” according to this notation.

I—Example of a Device Implementing the Method

FIG. 1 shows an example of a device comprising means for implementingthe method for writing and reading data according to the disclosure. Thedevice is in the form of a integrated circuit ICC on a semiconductorwafer comprising a nonvolatile memory NVM, a volatile memory VM, aprocessing unit PU, and a communication interface ICT. The memories NVMand VM are linked to the processing unit PU by means of a data andaddress bus BS, and of a control bus (not shown). The memory NVM is abyte-programmable and page-erasable memory, for example a FLASH memorycomprising pages of 256 bytes.

The processing unit PU, for example a microprocessor or amicrocontroller, is equipped with a program memory PMEM in which isstored a “virtualization” program VPG of the memory NVM, configured toexecute an example method of the disclosure. Alternatively, theprocessing unit PU may be a hard-wired sequencer (state machine or amicroprogrammed control unit) configured to execute an example method ofthe disclosure without the intervention of a program stored in aprogrammed memory. Therefore, phrases such as “the executed program”,“the program is configured to”, “the program manages”, “the programperforms” that may be used in the following do not signify that theexample method according to the disclosure is exclusively implemented inthe form of a program implemented by a microprocessor.

In the embodiment example shown in FIG. 1, the integrated circuit ICC ismounted on or embedded in a portable support HD (“Handheld Device”), forexample a card made of a plastic material. The circuit ICC comprisesinterface communication means ICT of contact or contactless type, forexample ISO 7816 contacts or a communication interface by inductivecoupling ISO 14443 or ISO 15693. The integrated circuit receives, bymeans of the interface ICT, commands WR(LBA, DT) for data writing in thememory NVM and commands RD(LBA) for data reading in the memory NVM. Eachcommand comprises a command code and a logical address LBA of the datato read or to write. A write command also comprises a data DT to writein the memory.

The virtualization program VPG manages the contents of the memory NVMand ensures the execution of write and read commands in such a mannerthat, seen from the exterior, the memory NVM is seen as a virtualblock-programmable memory, in which a block of data may be indefinitelyprogrammed without worrying about its erasure. The logical addresses LBAsupplied with the commands thus form addresses designating blocks of thevirtual memory. Such addresses are called “logical addresses” and theblocks that they designate are “logical blocks”.

On the interior of the memory NVM, the program VPG ensures the datawriting according to a method of writing with delayed erase. As anexample, a step of writing with delayed erase of the following byte:

-   -   “01010101”        comprises writing this data in an erased byte of which all the        bits are at 1:    -   11111111,        and may, in one embodiment, need only involve the programming of        the first, third, fifth, and seventh bits of the byte in order        to set them at 0.

Thus, in response to a data write command, the program VPG writes thedata in erased memory cells, and more precisely need only program thememory cells that are to contain a bit equal to 0. This “writing”reduced to a programming of memory cells is done without erasingprevious data having the same logical address, which may have alreadybeen programmed in the physical memory. These previous data areinvalidated by the program VPG but are not erased.

The program VPG ensures the later erasure of the invalid data during theexecution of memory maintenance tasks, to obtain new erased memory cellsready to receive data.

Besides tasks of erasing invalid data, the program VPG may conductmaintenance tasks consisting of regrouping the valid data that aredispersed in the memory array in order to reveal groups of invalid datathat will then be erased in order to free up memory space.

Now will be described in further detail various aspects of an examplemethod for writing and reading data according to the disclosure,implemented by means of the program VPG.

II—First Aspect: Provision of a Metadata Zone

In the prior art, the programming of data blocks in pages erasedbeforehand includes each data being written in a block of which thephysical address is different than the logical address. The data of thetype “block” is “labeled” in a manner similar to the labeling of pagesin the methods described by U.S. Patent Application Publication No.US2008/0301357 or U.S. Patent Application Publication No.US200510251643, which are both herein incorporated by reference in theirentirety. The label is for example the logical address of the data andis concatenated with the data. Such a labeling method applied to datablocks rather than to data pages entails a prohibitive multiplication ofthe number of labels and a complication of the labels (the address of ablock being longer than the address of a page), leading to a memoryspace congestion problem due to the labeling data.

The disclosure proposes an advantageous solution allowing for theidentification of data in a memory space, without having to resort tothe conventional labeling technique, by providing management dataarranged in a dedicated memory space and allowing for the memorymanagement by reference to a virtual memory structure.

FIG. 2 shows schematically such a virtual memory structure, that is tosay the memory as seen from the exterior thanks to the program VPG. FIG.2 also shows the physical memory space organization inside the memoryNVM.

The virtual memory comprises K+1 logical pages LP (LP0, LP1 . . . LPK)designated by the logical addresses LPA (00, 01 . . . K). The logicalpages LP are here of the same size as the material pages of the memoryzone A1 of the memory NVM, here 256 bytes, and are divided intoindividually addressable logical blocks LB and are designated by theaddresses LBA present in the commands WR and RD. The address LBA of alogical block is formed by the address LPA of the logical page in whichthe block is found and by the index of the block in the page, that is tosay its rank in the page.

In an embodiment, the number of blocks per logical page is aninitialization parameter of the program VPG, the choice of which is leftup to the discretion of the user. It will be supposed in the followingand throughout the entire description, in a non-limiting manner, thatthe logical pages are divided into four logical blocks LB (LB1, LB2,LB3, LB4) of 64 bytes each.

The physical memory space is divided into a memory zone A1 provided tostore application data received by write commands WR, and a memory zoneA2 provided to receive the previously-cited management data, which isprovided to manage the data present in the first memory zone. Suchmanagement data will be called “metadata” in order to distinguish themfrom the application data and therefore consist of data concerning theapplication data.

The memory zone A1 comprises N+1 data physical pages DPP (DPP0, DPP1, .. . DPPN) designated by physical addresses DPPA (00, 01, . . . N). Thephysical pages are preferably of the same size as the logical pages andare therefore here of the same size as the material pages of the memory.They each comprise the same number of physical blocks as a logical page,that is four physical blocks PB (PB1, PB2, PB3, PB4) of 64 bytes each.

The notion of “physical block” represents, for the virtualizationprogram VPG, the smallest part of the physical memory that may bewritten in response to a logical block write command, and is independentof the memory NVM material architecture, here a byte-programmablememory, for which the smallest programmable data is therefore a byte. Inaddition, a “physical page” represents here, for the virtualizationprogram VPG, the smallest erasable part of the physical memory area,that is the material page of the memory NVM.

At the physical interface level of the memory, the writing of a physicalblock of 64 bytes may result in the application of 64 byte programminginstructions to the memory. The low level interface part of the programVPG will not be described in detail here. The program VPG may forexample call a “block write” sub-program comprising 64 iterations of abyte programming loop. During the block programming, the data to writeare placed in a buffer and the sub-program is called by the program VPG.Similarly, the program VPG may call a “block read” sub-programcomprising 64 iterations of a byte read loop. Alternatively, theprocessing unit PU is configured to read the memory NVM by words of 32or 64 bits.

Still in reference to FIG. 2, the memory zone A2 comprises metadataphysical pages MPP designated by their physical address MPPA. Contraryto the memory zone A1, the program VPG manages the memory zone A2without a notion of “block”, and programs the metadata by exploiting thenatural granularity offered by the memory, here a granularity of a bytefor writing and for reading, and a granularity of a page for erasing.

On the other hand, the program VPG implements the data write method withdelayed erase both in the memory zone A1 and in the memory zone A2.Thus, maintenance tasks are equally provided in the memory zone A2 so asto free up memory space for the metadata by erasure of pages containinginvalid metadata.

In this example, the memory zones A1, A2 being two sectors of the memoryNVM, the top and bottom limits of memory zones A1, A2 may be defined bythe program VPG as a function of parameters such as the physical memorysize and the size of logical blocks within virtual memory pages. Theprogram VPG determines an optimum repartition between the memory spaceattributed to data and the memory space attributed to metadata, and thusdetermines the limits of each memory zone. The physical memory zone A1is necessarily larger than the virtual memory zone due to the invaliddata generated by the delayed-erase write method. For example, if thememory NVM comprises 1024 pages and if the logical block size is 64bytes (that is 4 blocks per logical page), the program may attribute 896pages to the zone A1 (that is 224 kB of data) and 128 pages to the zoneA2 (that is 32 kB of metadata), and define a virtual memory of 218 kBrepresenting 85.2% of the memory space offered by the physical memory.

In other embodiments, the memory zone A2 may be located in a dedicatednonvolatile memory, distinct from the memory NVM. In this case, thememory zone A2 may comprise physical pages having a size different thanthat of physical pages of the memory NVM. Generally, the methodaccording to the disclosure does not impose a structural relationbetween the physical pages of metadata and the physical pages of data,and involves metadata that are read- and write-accessible with asufficient granularity so as to not slow down the program execution.

Metadata Structure Example

The correspondence between the physical addresses of physical blocks PBof data and the logical addresses of logical blocks, is ensured by meansof a metadata structure configured in the memory zone A2 by the programVPG. In an embodiment, this metadata structure comprises compactelements associated with physical pages of the memory zone A1, called“descriptors” DSC0, DSC, . . . DSCN. The descriptors ensure the linkbetween the logical pages and the physical pages as well as the linkbetween the physical blocks and the logical blocks. They also compriseinformation about the status, valid or invalid, of the data present inthe physical blocks.

Each descriptor comprises for example the following fields:

-   -   a physical address field DPPA,    -   a field WC,    -   a logical address field LPA, and    -   a Data Status field DS for each physical block PB1, PB2, PB3,        PB4 of the physical page with which the descriptor is        associated, that is here four fields DS in total: DS(PB1),        DS(PB2), DS(PB3), DS(PB4).

The physical address field DPPA receives the address DPPA of thephysical page with which the descriptor is associated, preferably in theform of an index indicating the position of the physical page in thememory zone A1 relative to the first address of the memory zone A1.Similarly, the logical address field LPA receives the logical addressLPA of a virtual memory page, preferably in the form of an indexindicating the position of the logical page in the virtual memory.

The field WC is reserved for a usage that will be described later but isalso used to invalidate a descriptor. The invalidation value of thedescriptor is obtained by programming all the bits of the field WC, thatis “000000” in hexadecimal notation.

The fields DS are indexed fields describing the status of the data inthe blocks of the physical page with which the descriptor is associated.More particularly, the rank of each field DS in the descriptorcorresponds to the rank, in the physical page with which the descriptoris associated, of the physical block with which the field DS isassociated. Thus, the field DS(PB1) appears in the first position in thedescriptor and is associated with the first block PB1 of the physicalpage with which the descriptor is associated. The field DS(PB2) appearsin the second position in the descriptor and is associated with thesecond block PB2 of this physical page, etc., the number of fields DS ina descriptor being a function of the number of blocks per physical page.

The contents of each field DS contain an information that is coded inthe following manner:

-   -   an erased field DS (only containing 1's) signifies that the        corresponding physical block PB is erased,    -   a programmed field DS (only containing 0's) signifies that the        corresponding physical block PB contains an invalid data,    -   a partially programmed field DS and containing a value “I”        between 1 and 4 signifies that the corresponding physical block        PB contains the data of the logical block of the index “I” in        the logical page, the address LPA of which appears in the        descriptor.

In an embodiment, the size of descriptor fields is for example thefollowing:

-   -   DPPA: 2 bytes, with a useful value between 0 and FFFE, the value        FFFF being reserved for the identification of a free descriptor        (i.e., in the erased state),    -   WC: 3 bytes,    -   LPA: 2 bytes, with a useful value between 0 and FFFE, the value        FFFF being reserved for the identification of a free physical        page (i.e., that is not yet associated with a logical address),    -   DS: 1 byte plus 1 redundant byte of the same value.

The size of a descriptor is in this case 15 bytes, and a physical pageof 256 bytes of the memory zone A2 may receive 16 descriptors, with 16remaining bytes available to code a page header in a manner that will bedescribed later.

During the first utilization of the memory, the program NVM configuresthe descriptors in a manner such that each physical page of the memoryzone A1 is associated with a descriptor. The field WC, described later,is equally configured during the first utilization of the memory. Atthis stage, as no data have been written in the memory zone A1, thedescriptors are not associated with any logical page and the field LPAis left in the erased state. Similarly, the fields DS are left in theerased state.

FIG. 2 is an “image” of memory zones A1 and A2 and of the virtual memoryat a given moment. The data and the metadata shown therein, given by wayof example only, are coded in hexadecimal format and are reduced to abyte to simplify the drawing. Thus, in the drawing, a data or a metadatamay have values between 00 (data or metadata of which all the bits areprogrammed) to FF (data or metadata completely erased), the intermediaryvalues being composed of programmed bits (0) and erased bits (1).

The virtual memory being an “ideal” memory, it only comprises validdata. Found therein are data DT1c, DT2, and DT3 saved respectively inthe logical blocks LB1, LB4 and LB2 of the logical page LP1 of address01. All the other logical blocks are equal to FF, which signifies thatthey have not received data.

Valid data DT1 c, DT2 and DT3 are found in the memory zone A1. The dataDT2 is saved in the block PB3 of the page DPP0 of address 00, and thedata DT3 is saved in the block PB4 of this page. The data DT1c is savedin the block PB1 of the physical page DPP2 of address 02. Also found inthe memory zone A1 are invalid data DT1a, DT1b saved in the blocks PB1and PB2 of the physical page DPP0.

The link between the location of the data in the physical memory A1 andtheir location in the virtual memory is ensured by the descriptors, bymeans of the fields described above. The descriptors also indicate thedata status (valid or invalid).

Thus, the memory zone A2 contains a descriptor DSC0 associated with thepage DPP0 in which:

-   -   the field DPPA contains the address “00”, which signifies that        the descriptor is associated with the page DPP0,    -   the field LPA contains the address “01” and designates the        logical page LP1 of the virtual memory, which signifies that the        data of the logical page LP1 are stored in the physical page        DPP0,    -   the field DS(PB1) is equal to 00, which signifies that the        physical block PB1 of the page DPP0 contains an invalid data,    -   the field DS(PB2) is equal to 00, which signifies that the        physical block PB2 of the page DPP0 contains an invalid data,    -   the field DS(PB3) is equal to 04, which signifies that the        physical block PB3 of the page DPP0 contains a valid data        located in the fourth logical block LB4 of the logical page LP1        (that is DT2),    -   the field DS(PB4) is equal to 02, which signifies that the        physical block PB4 of the page DPP0 contains a valid data        located in the second logical block LB4 of the logical page LP1        (that is DT3).

The memory zone A2 also contains a descriptor DSC2 associated with thepage DPP2 in which:

-   -   the field DPPA contains the address “02”, which signifies that        the descriptor is associated with the page DPP2,    -   the field LPA contains the address “01” and designates the        logical page LP1 of the virtual memory, which signifies that the        data of the logical page LP1 also were saved in the physical        page DPP2,    -   the field DS(PB1) is equal to 01, which signifies that the        physical block PB1 of the page DPP2 contains a valid data        located in the first block LB1 of the logical page LP1 (that is        DT1c),    -   the fields DS(PB2), DS(PB3), and DS(PB4) are equal to FF, which        signifies that the physical blocks PB2, PB3, PB4 of the page        DPP2 do not contain data.

The memory zone A2 also comprises the other descriptors DSC2 . . . DSCNof other physical pages of which the field DPPA comprises the address ofthe associated page, and of which the fields LPA, DS(PB1), DS(PB2),DS(PB3), DS(PB4) are erased (equal to FF), signifying that all the otherpages of the memory zone A2 do not contain data.

The ensemble of the descriptors thus forms the equivalent of a compactdatabase that allows, at each moment, to know to which logical blockeach data in each physical block belongs, and to know whether the datais valid or invalid.

The metadata structure having been described, aspects relative to thedynamic utilization of the descriptors and to their configuration duringmemory write operations will now be described.

Data Write Sequence Example

FIG. 3 is a flowchart describing, in a simplified manner, the executionof a data write operation in a logical block LBi(LPj) of a logical pageLPj. During a step S01, the program VPG searches for a physical pageDPPk linked to the logical page LPj by scanning the descriptor fieldsLPA. When the page DPPk is found, the program VPG searches for an erasedphysical block PBi in the page DPPk by scanning the descriptor fields DSuntil it finds a field DS equal to FF, indicating that the block iserased. The rank of the field DS in the descriptor allows the programVPG to deduce the physical block index in the page DPPk, the address ofwhich appears in the field DPPA, and thus allows it to reconstruct theblock address by adding the index to the address DPPA. During a stepS03, the program VPG writes the data DT in the physical block PBi of thepage DPPk. During a step S04, the program VPG links the physical blockPBi of the page DPPk to the logical block LBi of the logical page LPj bywriting, in the descriptor field DS relating to the block PBi, the indexof the logical block LBi in the page LPj. In a virtual memory structureof 4 blocks per page, this index corresponds to two insignificantaddress bits of the logical block LBi such as supplied with the writecommand.

It may happen that at the step S02 the program VPG does not find anerased field DS, which signifies that the physical page does notcomprise an available block for writing the data. In this case, theprogram VPG returns to the step S01 to search in the descriptors for anew physical page linked to the logical page LPj.

It may also happen that at the step S01 the program VPG does not find aphysical page DPPk linked to logical page LPj. In this case, the programVPG goes to a step S05 where it chooses a descriptor associated with avalid physical page DPPk that is not linked to any logical page (erasedfield LPA) and is therefore in the erased state. The program VPG linksthe physical page to the logical page LPj by programming the logicalpage address in the field LPA of its descriptor. Then, during a stepS06, the program VPG writes the data DT in the first physical block PB1of the page DPPk. During a step S07, the program VPG links the physicalblock PB1 to the logical block LBi by writing the logical block index inthe first descriptor field DS.

The flowcharts shown in the FIGS. 4A, 4B, 4C, 4D, and 4E describe in asimplified manner the writing of data DT1a, DT1b, DT1c, DT2, DT3 leadingto the physical memory configuration as shown in FIG. 2. The FIGS. 5A,5B, 5C, 5D and 5E show these steps and show how the configuration of thememory zones A1 and A2 evolves step by step during the data writinguntil the configuration of FIG. 5E is obtained, which is identical tothat of FIG. 2.

The flowchart of FIG. 4A describes the execution steps of a writecommand of a data DT1a in the logical block LB1(LP1) (first logicalblock of the logical page LP1). During a step S11, the program VPGsearches in the descriptors for a physical page linked to LP1 and doesnot find one (in this example, the memory is supposed to be entirelyblank). During a step S12, the program VPG chooses the erased physicalpage DPP0 and updates the descriptor DSC0 of this page by writing thevalue 01 in the field LPA so as to link it to the logical page LP1.During a step S13, the program VPG writes the data DT1 a in the blockPB1(DPP0), Cf. FIG. 5A, and updates the descriptor DSC0 by writing inthe field DS(PB1) the value 01 representing the index of the logicalblock LB1(LP1)).

The flowchart of FIG. 4B describes the execution steps of a writecommand of the data DT1b in the same logical block LB1(LP1). During astep S14, the program VPG searches in the descriptors for a physicalpage linked to the logical page LP1, finds the page DPP0, then searchesin its descriptor for an erased physical block and finds the erasedfield DS(PB2). During a step S15, the program VPG writes the data DT1bin the physical block PB2(DPP0), writes all the bits of the descriptorfield DS(PB1) to invalidate the data DT1a present in the block PB1, andwrites the value 01 in the field DS(PB2), Cf. FIG. 5B, which signifiesthat the valid data DT1b of the logical block LB1(LP1) is now found inthe physical block PB2(DPP0).

The flowchart of FIG. 4C describes the execution steps of a writecommand of the data DT2 in the logical block LB4(LP1). During a stepS16, the program VPG searches in the descriptors for a physical pagelinked to the logical page LP1, finds the page DPP0, then searches, bymeans of the descriptors, for an erased physical block in the page DPP0.During a step S17, the program VPG writes the data DT2 in the physicalblock PB3(DPP0), then writes the value 04 in the field DS(PB3) of thedescriptor, Cf. FIG. 5C.

The flowchart of FIG. 4D describes the execution steps of a writecommand of the data DT3 in the logical block LB2(LP1). During a stepS18, the program VPG searches in the descriptors for a physical pagelinked to the logical page LP1, finds the page DPP0, then searches, bymeans of the descriptors, for an erased physical block in the page DPP0.During a step S19, the program VPG writes the data DT3 in the physicalblock PB4(DPP0), then writes the value 02 in the field DS(PB4) of thedescriptor, Cf. FIG. 5D.

The flowchart of FIG. 4E describes the execution steps of a writecommand of the data DT1c in the logical block LB1(LP1). During a stepS20, the program VPG searches in the descriptors for a physical pagelinked to the logical page LP1, finds the page DPP0, then searches, bymeans of the descriptors, for an erased physical block in the page DPP0.The page DPP0 being entirely written, the program VPG searches for anerased page at step S21, chooses the physical page DPP2 and updates thedescriptor DSC2 of this page by writing the value 01 in the field LPA soas to link it to the logical page LP1. During a step S22, the programVPG writes the data DT1c in the physical block PB1(DPP2), updates thedescriptor DSC0 by writing all the bits of the field DS(PB2) of thedescriptor DSC0 so as to invalidate the data DT1b present in thephysical block PB2(DPP0 ), and updates the descriptor DSC2 by writingthe value 01 in the field DS(PB1).

It may be noted that the order of the operations described above isarbitrary in that it relates to the updating of descriptors. Theseoperations may be conducted according to a determined order in theframework of the implementation of a method of protecting against powersupply interruptions, which will be described later.

As it will appear in the light of the described examples, the data of alogical page may be saved in several physical pages and the data writtensuccessively in the same logical block may remain in the physicalmemory. Nevertheless, in one example, there may only be one valid dataper logical block, such that each writing of a data of a logical blockinvolves the invalidation of the previously written data.

Additionally, supposing that the write method shown in FIGS. 5A to 5Econtinues and that the logical blocks LB3, LB4 of the page LP1 receivenew data, the data DT2, DT3 present in the physical page DPP0 will beinvalidated and the page DPP0 will only contain invalid data. Such apage will be invalidated then erased by the program VPG in order to freeup memory space.

The erasure of a page implicates the attribution of a new descriptor tothe page and the invalidation of the descriptor associated with thispage. As the writing of metadata in the memory zone A2 is of thedelayed-erase type and therefore comprises a data write, it is not infact imaginable to erase the current descriptor of the page so as to setthe fields LPA and DS back to “FF”. Thus, the program VPG allocates anew descriptor to the page and invalidates the old descriptor by settingits field WC to 0.

It may be noted that the compact descriptor structure chosen in thisembodiment of the method imposes that a physical page only comprisesdata belonging to a same logical page. In embodiment variations, adescriptor structure of the type “block descriptor” may be provided andallow for the association of any logical page to any physical block ofany physical page. Such a block descriptor structure would however bebulky because each block descriptor would have to comprise the addressesDPPA and LPA of the physical and logical pages with which it isassociated. The page descriptors including an information about theblock contents of the page thus form an advantageous means in terms ofthe memory zone A2 compactness.

III—Second Aspect: Page Wear Management

An inconvenience of the delayed-erase data write is that the program VPGmay arbitrarily favor the cycling of certain pages to the detriment ofother pages. It may happen that a same page is arbitrarily used moreoften than the others, and therefore more often erased than the others.For example, in the preceding it has been seen that at certain steps ofthe data write method, for example step S05 in FIG. 3 and step S21 inFIG. 4E, the program VPG chooses erased pages so as to write new data inthem.

According to an aspect of the disclosure, metadata are also used toensure a monitoring of the page “cycling” (that is to say the number oferase cycles that they have undergone). More particularly, a wearcounter WC is attributed to each physical page of the memory zone A1,and is saved in the memory zone A2. The counter WC may be arranged in adedicated wear descriptor in which the address of the page appears.However, in the framework of the implementation of the first aspectwhere page descriptors are used, it is advantageous to place thiscounter WC in the descriptor structure, as shown in FIG. 2.

The counter WC is for example coded on 3 bytes, as indicated above.During the first memory utilization, the program VPG initializes thecounter WC of each physical page of data by writing therein a countvalue equal to 000001 (hexadecimal notation) at the time of the firstdescriptor configuration. The program VPG then increments the counterafter each erase of the page. The counter WC thus accompanies the pageduring the entire life of the memory. In the FIGS. 5A to 5E, it may beseen for example that the counter WC of the descriptor DSC0 of the pageDPP0 is equal to 000001, which signifies that the page has not yet beenerased. In FIG. 5E, the counter WC of the descriptor DSC2 of the pageDPP2 is equal to 000008, which signifies that the page has been erased 7times.

Thanks to the counter WC, the cycling of data pages may be controlled bythe program VPG in a dynamic and/or static manner so as to homogenizethe page wear over the entire memory array. A dynamic wear managementcomprises for example, during the writing of data in erased physicalpages, a step during which the program VPG selects erased pages havingundergone the least amount of erase cycles. A static wear managementcomprises for example a core task (background task) comprising steps ofmoving valid data of a page having undergone a small number of erasecycles to a page having undergone more erase cycles, so as to free up aless-frequently cycled page so that it may be used more frequentlylater.

As indicated above, the erasure of a data page DPP is accompanied by theattribution of a new descriptor to the page, which implies that theinvalidation of the descriptor associated with this page comprisessetting the field WC to 0. So as to not lose the page wear “history”,the counter WC of a descriptor destined to be invalidated is transferredbeforehand into the new descriptor of the erased page.

Advantageously, the metadata page wear is equally monitored andhomogenized by the program VPG by allocating to them a counter WC, herearranged on the interior of the metadata pages, in a header field HD ofthese pages. As shown in FIG. 6, a descriptor page comprises the headerfield HD and a plurality of descriptors DSCi, DSCi+1, . . . DSCi+n eachcomprising the fields DPPA, WC, LPA, DS(PB1), DS(PB2), DS(PB3), DS(PB4).The header field comprises:

-   -   the counter WC, of 3 bytes,    -   a start flag SFG, for example of 1 byte,    -   an identification field MID (Metadata Identifier), for example        coded on 3 bytes, and    -   a final flag FFG, for example of 1 byte.

The flags SFG, FFG are provided in relation with an aspect that will bedescribed later. The identification field MID is coded with a determinedvalue, for example “3C”, which indicates that the metadata page containsdescriptors. The field MID is also used to invalidate the descriptorpage when it only contains invalid descriptors. In this case, the fieldMID is completely written and its value is “00” in hexadecimal notation.Finally, when the field MID is equal to “FF”, this signifies that themetadata page is available and may be used to save descriptors or anyother metadata structure that will be described later.

After a certain usage of the memory, a descriptor page may contain onlyinvalid descriptors, that is descriptors all relating to pagescontaining invalid data. The program VPG may be configured to conduct acore task that aims to find pages of invalid descriptors, then to erasethem so as to free up memory space in the memory zone A2. In this case,the counter WC of the descriptor page to be erased is set asidebeforehand then rewritten in the header field of the descriptor pageafter it has been erased.

A dynamic metadata page wear management may also be provided, andcomprises for example, during the writing of metadata in erased physicalpages of the memory zone A2, a step during which the program VPG selectserased pages having undergone the least number of erase cycles. A staticmetadata page wear management may also be provided and comprises forexample a core task (background task) comprising steps of moving validdata of a page having undergone a small number of erase cycles to a pagehaving undergone more erase cycles.

More-detailed features of the implementation of this aspect will bedescribed later, in the framework of the description of other aspects.

IV—Third Aspect: Protection of Data Against Power Supply Interruptions

The management of the tearing and of the power supply interruptionscaused by it conventionally involves the provision of specific dataallowing the write and erase processes to be monitored. During a memoryrestart, these data are read and allow for the detection of the processinterruption in order to set the memory back into its initial state andalso to correct the effects of the power interruption. In the manner ofconventional labeling data, the process monitoring data are, in theprior art, concatenated to the application data and become more and morecomplicated as one passes from a writing by page to a writing by block.Not only labeling data but also process monitoring data is concatenatedwith each block of application data. Moreover, as the labeling ofapplication data with process monitoring data is not a foolproof method,incertitude remains when the memory cells receiving the processmonitoring data are in an intermediary state between the programmedstate and the erased state, and may be read as a “1” or a “0” dependingupon external parameters such as the temperature and the circuit supplyvoltage, which may lead to an erroneous diagnostic. The limits of knowntechniques reside in the fact that the process monitoring data areconcatenated to the application data and are thus attributed to a fixedmemory space, inhibiting the implementation of solutions aiming toprevent diagnostic errors due to intermediate states.

According to this aspect, metadata of the memory zone A2 are allocatedto the process monitoring. In the manner of metadata allowing for theidentification of data in the memory zone A1, which are configured asdescriptors, the metadata allocated to the process monitoring areconfigured as specific structures called “temporary informationstructures” TINF, as shown in FIG. 7. These metadata structures arewritten in specific metadata pages called “temporary information pages”of which the structure is also shown in FIG. 7.

A temporary information page comprises a header field HD following by aplurality of temporary information structures TINFi, TINFi+1, . . .TINFj. The header field is identical to that of a descriptor page andthus comprises:

-   -   the counter WC of the page,    -   the flag SFG,    -   the identification field MID, and    -   a flag FFG, for example of 1 byte.

The identification field MID is coded with a determined value, forexample “F0”, which indicates that the metadata page is a temporaryinformation page. The field MID is also used to invalidate the temporaryinformation page when it contains only invalid temporary informationstructures. In this case, the field MID is completely written and itsvalue is equal to “00” in hexadecimal notation.

In an embodiment, the method provides:

-   -   a temporary information structure DPI (“Data Programming        Information”) for the monitoring of the write process of a        physical block of data in the memory zone A1,    -   a temporary information structure DEI (“Data Erasing        Information”) for the monitoring of the erase process of a        physical page of data in the memory zone A1,    -   a temporary information structure MEI (“Metadata Erasing        Information”) for the monitoring of the erase process of a        metadata page in the memory zone A2,    -   a temporary information structure DPRI (“Descriptor Page        Rearranging Information”) for the monitoring of a process of        rearranging the descriptors in the memory zone A2.

These temporary information structures will now be described in furtherdetail in relation with their usage.

Monitoring of the Write Process of a Physical Block of Data in theMemory Zone A1

The structure DPI comprises the following fields:

-   -   a start flag SFG, for example of 1 byte    -   a final flag FFG, for example of 1 byte,    -   a field TYPE, for example of 1 byte, allowing the structure DPI        to be identified,    -   a descriptor address field DAD, for example of 1 byte,    -   a DS index field DSIND, for example of 1 byte.

The field DAD receives the descriptor address of the physical page inwhich the data are written. This address comprises the address MPPA ofthe metadata page in which are found the descriptor (expressed in theform of an index calculated relative to the first page of the secondmemory zone A2), and the index DIND of the descriptor in the metadatapage. The field DSIND receives the index, in the descriptor, of thefield DS concerned by the write operation. As 4 bits suffice todesignate the four possible index values in a virtual memory of fourblocks per logical page, the four other bits of the field DSIND may beused to store the value to be written in the field DS. As indicatedabove, this value is the index, in the logical page, of the logicalblock of which the data is to be written in the physical block.

The program VPG configures the structure DPI in several steps before thewriting of a data in a physical block of the memory zone A1:

1) writing of half of the flag SFG bits,

2) writing of the field TYPE, of the field DAD, and of the field DSIND,

3) writing of the other flag SFG bits.

The write operation of the block is then performed. When this operationis finished, the program VPG writes the final flag FFG.

The start flag SFG being written in two steps, it is equivalent to twoflags, that is a first process start flag and a second process startflag, allowing for the organization of the writing process of the fieldsTYPE, DAD, and DSIND of the temporary information structure.

Monitoring of the Erase Process of a Physical Page of Data in the MemoryZone A1

The structure DEI comprises the following fields:

-   -   a start flag SFG, for example of 1 byte,    -   a final flag FFG, for example of 1 byte,    -   a field TYPE, for example of 1 byte, allowing the structure DEI        to be identified,    -   a Data Physical Page Address field “DPPA”, for example of 2        bytes,    -   an Old Descriptor Address field “ODAD”, for example of 2 bytes,

The field DPPA, already described above, receives the address of thephysical page of data to erase, in the form of an index. The field ODADcontains the address of the old descriptor, which is the descriptor ofthe page before its erasure. Indeed, as indicated above, the erasure ofa page is necessarily accompanied by the writing of a new descriptor.

The program VPG configures the structure DEI in several steps before apage is erased:

1) writing of half of the flag SFG bits,

2) writing of the field TYPE, of the field DPPA, and of the field OAD,

3) writing of the other flag SFG bits,

When the erase operation of the data page is finished, the program VPGwrites the final flag FFG.

Monitoring of the Erase Process of a Metadata Page in the Memory Zone A2

The structure MEI comprises the following fields:

-   -   a start flag SFG, for example of 1 byte,    -   a final flag FFG, for example of 1 byte,    -   a field TYPE, for example of 1 byte, allowing the structure MEI        to be identified,    -   a Metadata Physical Page Address field MPPA, for example of 2        bytes, and    -   a Wear Counter field “WC”, of 3 bytes.

The field MPPA, already described above, receives the address of themetadata page to erase, in the form of an index. The field WC receivesthe wear counter WC value of the metadata page to erase.

The program VPG configures the structure MEI in several steps before ametadata page is erased:

1) writing of half of the flag SFG bits,

2) writing of the field TYPE, of the field MPPA, and of the field WC,

3) writing of the other flag SFG bits.

When the page erase operation is finished, the program VPG recopies thecounter WC value in the field WC that is located in the header of theerased page, then programs the final flag FFG.

Monitoring of a Rearrangement Process of Descriptors in the Memory ZoneA2

The rearrangement of descriptors is a background task that may beperformed by the program VPG to regroup the valid descriptors in thesame descriptor page. It implicates the invalidation of initialdescriptors. This task allows descriptor pages only containing invaliddescriptors to appear, which may then be erased, and to increase theconcentration of valid descriptors in the valid descriptor pages. Thistask may also be performed in the framework of a static metadata pagewear management to transfer descriptors into the pages having undergonemore erase cycles, which have counters WC with higher values.

As the descriptors are to be protected against the power supplyinterruptions while they are being moved from one page to another, thetemporary information structure DPRI is provided to perform this task.It comprises the following fields:

-   -   a start flag SFG, for example of 1 byte,    -   a final flag FFG, for example of 1 byte,    -   a field TYPE, for example of 1 byte, allowing the structure DPRI        to be identified,    -   a Metadata Physical Page Address field MPPA, for example of 2        bytes.

The field MPPA receives the address MPPA of the metadata page in whichvalid descriptors will be read and moved into a new page, expressed inthe form of an index.

The program VPG configures the temporary information structure MEI inseveral steps:

1) writing of half of the flag SFG bits,

2) writing of the field TYPE and of the field MPPA,

3) writing of the other flag SFG bits.

Then, the program VPG moves the valid descriptors to the other page,then invalidates the source page by writing all the bits of the fieldMID of the page, as described above. The page will be erased by anotherbackground task, or “Garbage Collection” task, ensuring the erasure ofinvalid pages.

When the transfer operation of descriptors is completed, the program VPGwrites the final flag FFG of the temporary information structure.

Monitoring of the Write Process of the Descriptors

In addition to the information appearing in the temporary informationstructures, this monitoring is also ensured by means of byte redundancyin the fields DS of the descriptors, described above. In each field DS,the redundant byte is written after the first byte of the field has beenwritten. If a power supply interruption occurs during the writing ofthis field, the difference between the first and the second byte allowsfor the detection of the write process interruption.

Monitoring of a Write Process of Metadata Page Headers

The start flags SFG and the final flags FFG provided in the metadatapage headers also allow the program VPG to detect that a power supplyinterruption has occurred during the writing of the headers, the finalflag of the header being written last.

Execution of an Anti-Tearing Algorithm Upon Power on

Upon a power on, the program VPG executes an anti-tearing algorithm(i.e., that aims to counter the effects of a power supply interruption)and analyses the flags SFG, FFG present in the temporary informationstructures, in the descriptor page headers, and in the temporaryinformation page headers to detect any possible anomalies. It also looksfor byte redundancy anomalies in the descriptors if an incoherency hasbeen detected in the flags. A diagnostic is then established to define,if necessary, the actions to be performed in order to restore the memoryinto its initial state, that is to say its configuration before theoperation (write or erase) was launched, which was then interrupted bythe power supply interruption.

The analysis of temporary information metadata is for example performedin the following order:

1) verification of the validity of all the page headers,

2) search for the two last temporary information structures,

3) setting of instable pages detected by rewriting of bits alreadywritten or recopied from these pages and invalidation of initial pages,

4) analysis of the temporary information structures and treatment ofthem.

An anomaly is for example noticed when two flags of a same structure(temporary information or header) do not have the same value, whichmeans that a process was interrupted. The process that was interruptedmay be known by the field TYPE of the temporary information structures.Where the anomaly relates to a temporary information structure, theprogram VPG recopies this structure into a temporary information page ofthe memory zone A2 to stabilize it, before proceeding with a dataanalysis so as to establish a diagnostic and before defining anypossible corrective actions. When the erroneous temporary informationstructure has been recopied, the initial temporary information structureis neutralized by writing of its erased bits (going from 1 to 0) andoverwriting of its programmed bits.

For example, a final flag FFG may be in an intermediary state if a powerinterruption occurred while the program VPG was in the process ofwriting it. Such a flag may be read to be equal to 1 at the power on,which is considered to be an anomaly because the start flag is writtenand is thus equal to 0. Nevertheless, this same final flag may then beread to be equal to 0 at the following power on if a new power supplyinterruption occurs after the memory re-start and before the program VPGhad the time to establish a diagnostic. This change of the read value ofthe flag may depend upon external parameters such as the temperature orthe circuit power supply.

As a precautionary measure, recopying the temporary informationstructure and neutralizing the initial temporary information structureconsidered as “potentially unstable” (because it may not be knownwhether it is really stable) thus allows it to be stabilized. If a newpower supply interruption occurs during the writing of the temporaryinformation structure copy, such that the new structure itself has anerror, then a copy of the new temporary information structure during thenext power on will allow it to be stabilized and a diagnostic to beestablished. Thus, the fact of recopying the temporary informationstructure and of neutralizing the initial temporary informationstructure allow diagnostic errors due to memory cells in an intermediarystate to be avoided.

It may be noted that such a copy operation is impossible to implement ina conventional memory where the process monitoring data are written infixed-size fields provided at the start or the end of a page. A memoryspace dedicated to metadata and the ability to be able to reprogram thetemporary information structures so as to stabilize them thus offerunexpected advantages.

Descriptors having an anomaly may also be recopied. If a descriptor hasa byte redundancy error (bytes not having the same value), thedescriptor is recopied in order to stabilize it and the initialdescriptor is invalidated. In one embodiment, this operation is onlyperformed however if, at the moment of power interruption, the erroneousdescriptor was in the process of being written in relation with a datawrite operation in a physical block (the nature of the operation isdetermined by the field TYPE of the temporary information structure,which thus is information of the type DPI).

The header fields having an anomaly however are not recopied and aresimply overwritten because they do not have the same instability andvalidity problems: at the time when they are overwritten, the algorithmis in a stable state and at the next power on, they will necessarily berewritten with the same value.

V—Fourth Aspect: Provision of a Look-Up Table Pointing Towards theMetadata

In order to simplify the work of the processor performing the memorymanagement, it is common in the prior art to call upon a look-up tablelocated in the volatile memory, allowing the location of the labeledpages in the memory array to be determined. The look-up table comprisesa list of labels and, in relation with each label, a physical address ofthe data carrying this label. In the framework of the implementation ofa method of writing per block with a delayed erase, the increase of thenumber of labels also entails a proportional complication of the look-uptable structure and of the volatile memory size. A look-up table with acompact size may therefore be desired.

In an embodiment, the program VPG uses a compact look-up table LUT toaccess the memory NVM. The look-up table is stored in the volatilememory VM of the integrated circuit (Cf. FIG. 1) and is reconstructed,from a reading of the metadata, by the program VPG at each startup ofthe integrated circuit.

The look-up table LUT does not point towards the memory zone A1 wherethe data are located, but points towards the memory zone A2 where themetadata are located. In other words, the look-up table suppliesdescriptor addresses DAD. These addresses comprise an address MPPA of adescriptor page and the index DIND of a descriptor in this page. Thelook-up table is also used by the program VPG to manage and update alist of invalid pages to be erased, as well as to manage and update alist of erased pages.

FIG. 8 shows schematically a structural example of the look-up tableLUT. The look-up table has four distinct zones, a zone IDX, a zone EXT,a zone FRE, and a zone INV.

The zone IDX contains addresses of descriptors indexed on the logicaladdresses LPA. Each address LPA, corresponds to the address of a validdescriptor comprising this address in its field LPA. The zone EXT alsocontains descriptor addresses, but these addresses are not indexed tothe logical addresses LPA and are classed by increasing order of thelogical addresses that are in the field LPA of the descriptors.

The zone FRE contains descriptor addresses associated with erased pagesof the memory zone A1, that is descriptors of which the fields DPA andDS are in the erased state (the fields DPPA and WC being howeverreferenced upon the formation of the descriptors, as described above).The descriptor addresses are classed therein by increasing order (or,optionally, by decreasing order) of their counter WC values. In otherwords, the address of the first descriptor at the top of the zone FRE(or at the bottom, if decreasing order) is that of the erased descriptorhaving the lowest counter WC value and having thus undergone the fewesterase cycles.

The zone INV contains addresses of all the pages of invalid data presentin the memory zone A1. This zone is used by the program VPG to execute acore task aiming to free up memory space by the erasure of invalidpages.

Construction of the Look-Up Table

The program VPG constructs the look-up table LUT upon each power on ofthe integrated circuit. To this end, it sweeps all the descriptor pagesand searches, for each logical address LPA_(i), for the validdescriptors of which the field LPA comprises this address LPA_(i). Thefirst descriptor found is placed in the zone IDX and is associated withthe logical address LPA_(i). The other descriptors found meeting thiscriteria are placed in the zone EXT and are classed by increasing orderof the addresses LPA that they contain. Once all the logical addressesof the virtual memory space have been swept, the look-up table comprisesin its zone IDX and in its zone EXT all the addresses of validdescriptors associated with physical pages that comprise at least onevalid data of the virtual memory.

The zone EXT is constructed simultaneously to this sweep, by storingtherein the descriptor addresses of which the field LPA was found to bein the erased state, and by classing them by increasing (or decreasing)counter WC values that they comprise. Similarly, the zone INV may beconstructed simultaneously by storing therein the descriptor addressesof which the four fields DS are found to be equal to 0.

Utilization of the Look-Up Table

When the program VPG receives a write or read command of a logicalblock, the physical address of the logical block is first determined inorder to execute the command.

First of all, the program VPG extracts from the address of the logicalblock the address LPA of the logical page in which the logical block isfound and searches in the zone IDX, by means of this address LPA, forthe address of a descriptor. This step will now be described.

Search for a Descriptor by Means of the Zone IDX

Several cases may be envisaged:

i) The zone IDX does not contain any descriptor associated with thelogical address LPA_(i):

-   -   a) the command is a write command:

In this case the program VPG goes into the zone FRE and chooses theaddress of the descriptor that is on top of the list, to write the datain the physical page having undergone the least number of erase cyclesamong all the available erased pages. The address of this page isdetermined by reading the field DPPA of the selected descriptor.

-   -   b) the command is a read command:

In this case, the absence of a descriptor signifies that no data havebeen written at this logical address. The program VPG therefore returnsthe value “FF” signifying that the logical block is blank.Alternatively, the program VPG sends an appropriate response determinedby a communication protocol between the program VPG and the applicationthat uses it.

ii) The zone IDX contains the descriptor associated with the logicaladdress LPA_(i) and supplies a descriptor address:

-   -   a) If the command is a read command, the program VPG reads the        descriptor and searches for the field DS containing a value        equal to the logical block index in the logical page, and        deduces the index in the physical page of which the address DPPA        appears in the descriptor of the physical block containing the        searched-for data. The program VPG is thus able to reconstruct        the targeted address by combining the address DPPA and the        physical block index, and to read the data. If no field DS        containing the logical block index is found in the descriptor,        the program VPG continues the search in the zone EXT of the        look-up table.    -   b) If the command is a write command, the program VPG searches        for the first erased field DS in the descriptor. If the        descriptor only contains occupied fields DS, the program VPG        continues the search for the descriptor in the zone EXT of the        look-up table.

Search for Other Descriptors by Means of the Zone EXT

This zone not being indexed, the program VPG itself finds the descriptoror the descriptors that comprise the address LPA. As the descriptors areclassed therein by increasing order of the logical addresses LPA withwhich they are associated, the program VPG uses a convergent searchmethod by successive approaches that may involve the reading of severaldescriptors not comprising the correct address LPA_(i) but which allowsit to rapidly converge upon the descriptor comprising this address, ifone exists.

When the descriptor is found, the program VPG, if it is in the processof executing a write command, proceeds as it did with the firstdescriptor found by means of the zone IDX, and so forth until it findsthe descriptor comprising the address LPA and an erased field DS. If allthe fields DS are occupied or invalid, the program VPG goes into thezone FRE to select an erased page descriptor.

If it is in the process of executing a read command, the program VPGproceeds as it did with the first descriptor found by means of the zoneIDX, and so forth until it finds the descriptor comprising the addressLPA and a field DS comprising the logical block index to be read. Ifnone of the fields DS comprise this index, this means that no data wereprogrammed in this logical block. The program VPG therefore responds tothe command by sending the value “FF” signifying that the logical blockis blank or sends an appropriate response.

Invalidation of a Previous Data

When the received command is a write command, it may be necessary toinvalidate a previous data having the same logical address. Indeed, afield DS having the same index and thus designating a physical blockcontaining a data of the same logical address may exist in a descriptorassociated with the address LPA. This data will become obsolete afterthe writing of the new data and this field DS is therefore invalidated,as indicated above in relation with the FIGS. 5A to 5E.

Therefore, throughout the reading of the descriptors associated with thelogical address LPA, the program VPG also searches for a descriptorassociated with the target address LPA and that comprises a field DScontaining the same logical block index as that of the target logicalblock, and save the descriptor address as well as the index of the fieldDS. Thus, the program VPG does not stop at the searched-for descriptorto write the data, but sweeps the ensemble of the descriptors comprisingthe address LPA to confirm that a previously-written data having thesame logical address does not exist in the memory zone A1.

VI—General Architecture Example of the Program VPG Implementing the FourExample Aspects

FIG. 9 is a general view of tasks that may be performed by the programVPG, in an embodiment implementing the four example aspects. After thepower on of the integrated circuit, initialization tasks are firstperformed. The program VPG then performs dynamic tasks and slave tasks.

Initialization Tasks

A flowchart that summarizes the principal steps of these tasks is shownin FIG. 10. The steps appearing in this flowchart will be describedlater.

Dynamic Tasks

Once the initialization tasks have been done, the program VPG performsdynamic tasks or core tasks. The dynamic tasks are for example theexecution of write or read commands, or any other external command thatmay be provided, for example the execution of an invalidation command ofa logical page.

Execution of a Write Command

The execution of a write command has already been described throughoutthe entire preceding description. FIG. 11, described below, shows aflowchart that summarizes the execution steps of the command with animplementation of the aspects described herein.

Execution of a Read Command

The execution of a read command has already been described throughoutthe entire preceding description. FIG. 12, described below, shows aflowchart that summarizes the execution steps of the command with animplementation of the aspects described herein.

Core Tasks

The core tasks are executed in the absence of an execution command butmay also be performed before the execution of a command, if necessary.Among the core tasks, the following tasks may be noted:

Erasure of Invalid Data Pages

A flowchart that summarizes the principal steps of this task is shown inFIG. 13. The steps of this flowchart are described later.

Erasure of Invalid Metadata Pages

A flowchart that summarizes the principal steps of this task is shown inFIG. 14. The steps of this flowchart are described later.

Rearrangement of Valid Descriptors

A flowchart that summarizes the principal steps of this task is shown inFIG. 15. The steps of this flowchart are described later.

Defragmentation of Valid Data

A flowchart that summarizes the principal steps of this task is shown inFIG. 16. The steps of this flowchart are described later.

Static Page Wear Management

The task of static page wear management comprises transferring the dataor the metadata into the erased data or metadata pages having a counterWC with a higher value.

Slave Tasks

The so-called “slave” tasks are those that are implemented at the sametime as dynamic tasks or core tasks, and mainly relate to writingtemporary information structures for the anti-tearing algorithmimplementation and to updating the look-up table LUT.

The programming of the temporary information structures, alreadydescribed above, is done in relation with any task or command executionfor which a temporary information structure is provided, that is herethe writing of a physical block of data (temporary information structureDPI), the erasure of a physical page of data (temporary informationstructure DEI), the erasure of a metadata page (temporary informationstructure MEI), and the rearrangement of descriptors (temporaryinformation structure DPRI).

The dynamic wear management has been described above in relation withthe description of the counter WC and may be facilitated by the use ofthe look-up table LUT (zone FRE of the table) as far as it relates tothe data pages. As far as it relates to the metadata pages, the programVPG performs this task “on the fly” when the erased metadata pages arechosen, by reading the counters WC present in the header fields of thesepages, and by selecting the page having the lowest counter WC value.

Description of the Flowcharts

FIG. 10

The flowchart of FIG. 10 describes examples of initialization tasksafter power on:

During a step S60 the program VPG determines whether the memory is usedfor the first time, for example by determining whether the memory zoneA2 comprises metadata.

If the memory is blank, the program VPG executes a step S61 where itprograms all the descriptors at the rate of one descriptor per physicalpage:

-   -   All the counters WC of the descriptors are set to 1 (000001)    -   The address DPPA of the physical page allocated to each        descriptor is programmed in the corresponding field.

During a step S62, the program VPG executes the anti-tearing algorithm:

-   -   During a step S620, it reads the temporary information        structures TINF and searches for an anomaly.    -   During a step S621, it reprograms the temporary information        structure having the anomaly, if necessary, then neutralizes the        initial temporary information structure having the anomaly,        analyzes the data concerned by the interrupted operation,        establishes a diagnostic, and puts the memory back into the        state in which it was before interrupted operation began.

During a step S63 the program VPG constructs the look-up table LUT froma reading of the metadata.

FIG. 11

The flowchart of FIG. 11 describes the execution of a write command of adata DT in a target logical block LBi of index ILB_(i) of a targetlogical page address LPA_(i).

During a step S30, the program VPG reads the zone IDX of the look-uptable LUT by using the address LPA_(i) as index to find the address MPPAof the descriptor page linked to the target logical page and the indexDIND of the descriptor in the descriptor page.

During a step S31, the program VPG assembles the fields MPPA and DIND toobtain the descriptor address DAD.

During a step S32, the program VPG performs a first reading of thedescriptors to find the address DPPA of the target physical page linkedto the target logical page.

During a step S33, the program VPG performs a second reading of thedescriptors to find the index DSIND first erased field DS (FF) anddeduces the index of the target erased physical block PBj available toprogram the data.

During a step S34, the program VPG assembles the address DPPA and thephysical block index to obtain the address of the physical block PBj.

During a step S35A, the program VPG creates a temporary informationstructure TINF of the type DPI, and writes the following fields: a partof the flag SFG, the field TYPE, the field DAD (descriptor address), theindex DSIND of the field DS, and the value of the field DS, then therest of the flag SFG.

During a step S36, the program VPG writes the data in the physical blockPBj.

During a step S37, the program VPG updates the descriptor by writing, inthe erased field DS, the index ILB_(i) of the target logical block LBi.

During a step S35B, the program VPG programs the final flag FFG in thetemporary information structure DPI.

After the step S33, if it does not find an erased field DS in thedescriptor, the program VPG goes to a step S40 instead of going to thestep S34.

During the step S40, the program VPG searches in the look-up table LUTzone EXT for the address of another descriptor.

During a step S41, it reads the address field LPA present in thedescriptor.

During a step S42, the program VPG verifies whether the contents of theLPA are equal to the address LPA_(i) of the target logical page. If theresponse is positive, the program VPG returns to the step S32 to analyzethe descriptor. If the response is negative, the program VPG goes to astep S43.

During the step S43, the program VPG determines whether the look-uptable LUT may contain another descriptor address associated with thetarget logical page. The response is negative if the search bysuccessive approaches described above already allowed an examination ofall the address descriptors LPA close to LPAi (that is LPA_(i−1) andLPA_(i+1)) and no descriptor address exists between the already-analyzeddescriptor addresses. In this case, the program VPG goes to a step S44.If the search is not finished, the program VPG returns to the step S40.

During the step S44, the program VPG chooses a new erased physical pageall while applying the dynamic page wear management algorithm by meansof the counter WC, by searching for a descriptor having a counter WCwith a low value and for erased fields LPA. The erased physical pageaddress is read in the descriptor field DPPA.

During a step S45, the program VPG configures the descriptor of thechosen page by writing the descriptor field LPA.

During a step S46A, the program VPG creates a temporary informationstructure TINF of the type DPI, and writes the following fields: a partof the flag SFG, the field TYPE, the descriptor address field DAD, theindex DSIND of the field DS, and the value of the field DS, then therest of the flag SFG.

During a step S47, the program VPG writes the data in the first physicalblock of the chosen physical page.

During a step S48, it updates the descriptor by writing, in the firstdescriptor field DS, the index ILB_(i) of the target logical block LBi.

During a step S49, the program VPG updates the look-up table LUT.

During a step S46B, it writes the final flag FFG in the temporaryinformation structure DPI.

It may be noted that the flowchart that has just been described does notshow, for reasons of simplicity of the drawing, the step describedfurther above of searching for a descriptor of the same address LPAhaving a field DS with the same index ILB_(i) as the target logicalblock, so as to invalidate the field DS of this descriptor.

FIG. 12

The flowchart of FIG. 12 describes the execution of a read command of adata DT in a target logical block LBi of index ILB_(i) of a targetlogical page address LPA_(i).

During a step S50, the program VPG reads the zone IDX of the LUT byusing the address LPA_(i) as index, to find the address MPPA of thedescriptor page linked to the target logical page and the descriptorindex DIND in the descriptor page.

During a step S51, the program VPG assembles the address MPPA and theindex DIND to obtain the descriptor address DAD.

During a step S52A, the program VPG performs a first reading of thedescriptors to find the address DPPA of the target physical page linkedto the target logical page.

During a step S52B, it performs a second reading of the descriptors tofind the index DSIND of the field DS containing the index ILB_(i) of thetarget logical block LBi, and deduces the index of the target physicalblock PBj where the data to read are found. If no field DS is found withthis index, the program VPG goes to a step S55, otherwise it goes to astep S53.

During the step S53, the program VPG assembles the address DPPA and thephysical index block to obtain the address of the physical block PBj.

During the step S54, the program VPG reads the data in the physicalblock PBj and supplies them to the emitter of the command.

During the step S55, the program VPG searches in the look-up table LUTzone EXT for the address of another descriptor.

During a step S56, it reads the address LPA present in the descriptor.

During a step S57, the program VPG verifies whether the field LPAcontains the address LPA_(i) of the target logical page. If the responseis positive, it goes to the step 52A to analyze the descriptor,otherwise it goes to a step S58.

During a step S58, the program VPG determines whether the look-up tableLUT may contain another descriptor address associated with the targetlogical page. The response is negative if the above-described search bysuccessive approaches allowed all the address descriptors LPA to beexamined. In this case, the program VPG goes to a step S59. If thesearch is not finished, the program VPG returns to the step S55.

During the step S59, the program VPG concludes that the logical blockhas never been written, and sends to the command emitter a data DT=FF ora response provided in the command emitter's communication protocol.

FIG. 13

The flowchart of FIG. 13 describes an erase operation of an invalid datapage.

During a step S70, the program VPG creates a temporary informationstructure TINF of the type DEI and writes the following fields: a partof the flag SFG, the field TYPE, the address field DPPA of the physicalpage to erase, the field ODAD containing the descriptor address of thephysical page to erase, then the rest of the flag SFG.

During a step S71, the program VPG allocates a new descriptor to thephysical page in a metadata page, writes the field DPPA, and writes anincremented counter WC (WC=WC+1) value of the initial descriptor.

During a step S72, it erases the physical page.

During a step S73, it invalidates the old descriptor by setting itsfield WC to 0.

During a step S74, the program VPG writes the final flag FFG in thetemporary information structure DEI.

FIG. 14

The flowchart of FIG. 14 describes an erase operation of an invalidmetadata page.

During a step S80, the program VPG creates a temporary informationstructure TINF of the type MEI and programs the following fields: a partof the flag SFG, the field TYPE, the address MPPA of the physical pageto erase, the field WC, the counter WC value of the page (header), thenthe rest of the flag SFG.

During a step S81, the program VPG erases the physical page.

During a step S82, the program VPG writes the counter WC of the erasedphysical page with the value saved in the temporary informationstructure.

During a step S83, the program VPG writes the final flag FFG in thetemporary information structure MEI.

FIG. 15

The flowchart of FIG. 15 describes a rearrangement operation of validdescriptors of a metadata page.

During a step S90, the program VPG creates a temporary informationstructure TINF of type DEI and writes the following fields: a part ofthe flag SFG, the field TYPE, the address field MPPA of the physicalpage containing the valid descriptors to move, then the rest of the flagSFG.

During a step S91, the program VPG copies all the valid descriptors ofthe physical page into the free descriptors (DPPA=FF) of anotherdescriptor page containing only valid descriptors or the lowest possiblenumber of invalid descriptors.

During a step S92, the program VPG invalidates the metadata page bysetting the flag SFG to 0, then by setting the field MID to 0, andfinally by setting the flag FFG to 0.

During a step S93, the program VPG writes the final flag FFG in thetemporary information structure DEI.

During a step S94, the program VPG updates the look-up table LUT.

FIG. 16

The flowchart of FIG. 16 describes a defragmentation operation of validdata.

During a step S100, the program VPG looks for a fragmented logical pageby searching, by means of the descriptors, for the physical pages linkedto this page and containing valid data. A logical page is fragmented ifthe data that it contains are dispersed throughout several physicalpages.

During a step S101, the program VPG generates internal commands towrite, in a new erased page, data of the logical page that are presentin dispersed physical blocks, then it invalidates the source physicalblocks. The operation includes the dynamic wear management (selection ofan erased page having the lowest counter WC) and is secured by means ofthe temporary information structures. The descriptors of the new pageare updated, as well as the descriptors of the initial pages. Thelook-up table LUT is also updated.

Above, various aspects of the present disclosure have been described,that is:

-   -   the provision of a memory zone dedicated to the storing of        metadata that allows a connection to be made between logical        blocks and physical blocks and also allows for the management of        information about the status, valid or invalid, of data in the        physical blocks;    -   the provision of compact metadata structures of the page        descriptor type;    -   the provision of wear counters WC associated with pages of the        memory to implement a method of dynamic page wear management and        optionally a method of static wear management;    -   the provision of a memory zone dedicated to the storing of        metadata forming wear counters WC;    -   the provision of a memory zone dedicated to the storing of        metadata structured as temporary information ensuring a        monitoring of the method and to implement an anti-tearing        algorithm during the power on of the memory;    -   the provision of a look-up table pointing towards metadata        addresses instead of pointing towards data addresses, and also        facilitating the page wear management and the invalid page        erasure.

Each of these aspects may be implemented alone or in combination withall or only some of the other aspects described herein. For example,temporary information structures may be provided in a memory withoutdelayed erase, not requiring metadata of the descriptor type. Equally,wear counters may be provided without using metadata of the descriptortype or of the “temporary information” type. The look-up table LUT mayalso be used in relation with metadata structures different than thosewhich have been proposed in the preceding as an implementation example.

The embodiments described herein are equally susceptible to variousapplications. The methods described herein may be applied to any type ofmemory in which data is to be erased before being written, for exampleFLASH and EEPROM memories. Notably, the aspect relating to theutilization of metadata of the descriptor type is advantageously appliedto a FLASH memory by making it such that a “physical page” and a“logical page” within the meaning of the method correspond to anerasable material page of the FLASH memory. In other applications, a“physical page” may in some instances not comprise the smallest erasablepart of the memory used. For example, in a memory erasable by half-page,a physical page within the meaning of the method may include two halfpages and thus correspond to a material page of the memory. In a memoryerasable by block, with N blocks per page, a “physical page” within themeaning of the method may include M erasable blocks and may or may notcorrespond to a material page of the memory, depending on whether M andN are equal or not.

The various embodiments described above can be combined to providefurther embodiments. Aspects of the embodiments can be modified, ifnecessary to employ concepts of the various patents, application andpublications to provide yet further embodiments. These and other changescan be made to the embodiments in light of the above-detaileddescription. In general, in the following claims, the terms used shouldnot be construed to limit the claims to the specific embodimentsdisclosed in the specification and the claims, but should be construedto include all possible embodiments along with the full scope ofequivalents to which such claims are entitled. Accordingly, the claimsare not limited by the disclosure.

The invention claimed is:
 1. A method of managing data in electricallyerasable and programmable nonvolatile memory cells, the methodcomprising: defining data pages in a first nonvolatile memory zone;defining in the data pages programmable data blocks; defining in asecond nonvolatile memory zone, metadata pages comprising metadatastructures associated with the data pages present in the firstnonvolatile memory zone and wherein each of the data pages is associatedwith a metadata structure of the metadata pages, each metadata structureincluding a wear counter containing a value representative of a numberof times that the data page associated with the metadata structure hasbeen erased; attributing to each metadata page a wear counter containinga value representative of a number of times that a metadata page towhich the wear counter is attributed has been erased; and before erasingthe metadata page, writing in the second nonvolatile memory zone atemporary information structure including an address in the secondnonvolatile memory zone of the metadata page and the wear counterattributed to the metadata page.
 2. The method of claim 1, comprising:writing, in each metadata structure associated with a data page, aninformation about a status, valid or invalid, of the data page; anderasing data pages having a status of invalid as indicated in anassociated metadata structure of the data page.
 3. The method of claim1, comprising: invalidating a metadata structure associated with anerased data page; attributing a new metadata structure to the eraseddata page; and writing in the new metadata structure an incrementedvalue of a wear counter present in the invalidated metadata structure.4. The method of claim 1, comprising: invalidating a metadata structureassociated with an erased data page; and erasing a metadata page thathas only invalid metadata structures.
 5. The method of claim 4,comprising: invalidating a metadata page that has only invalid metadatastructures; and erasing the invalidated metadata page after theinvalidated metadata page becomes invalid.
 6. The method of claim 1,comprising: dynamically managing page wear, the dynamically managingcomprising: when data is to be written in a new data page of the firstnonvolatile memory zone, selecting, from among several erased data pagesof the first nonvolatile memory zone, a data page having a lowest wearcounter; and writing the data in the selected data page.
 7. The methodof claim 1, comprising: dynamically managing page wear, the dynamicallymanaging comprising: generating a list of page addresses of erased datapages of the first nonvolatile memory zone; classifying the addresses ofthe erased data pages in increasing or decreasing order according tovalues of wear counters in metadata structures associated with theerased data pages; when data is to be written in a new data page of thefirst nonvolatile memory zone, selecting, from the list of pageaddresses, an address of an erased data page based on the erased datapage with the selected address having a wear counter value in anassociated metadata structure that is lower than one or more other wearcounter values in associated metadata structures of erased data pageshaving addresses in the list of page addresses; and writing the data inthe erased data page associated with the selected address.
 8. The methodof claim 1, comprising statically managing page wear, the staticallymanaging page wear comprising transferring, into a second data page ofthe first nonvolatile memory zone, data present in a first data page,the second data page having a wear counter with a lower value than thatof a wear counter of the first data page.
 9. The method of claim 1,comprising: configuring the metadata structures associated with the datapages in the form of descriptors, a descriptor being associated with ametadata structure that is associated with a data page, and including: ametadata field for an associated wear counter included in the metadatastructure associated with the data page; a first field containing anaddress of an erasable data page in the first nonvolatile memory zone oran index indicating a position of the erasable data page in the firstnonvolatile memory zone; a second field containing an address of alogical page in a virtual memory or an index indicating a position ofthe logical page in a virtual memory; and for each data block of thedata page with which the descriptor is associated, a third fieldcontaining: an information about a location of the data block, in thedata page; an information about a status of the data block the statusbeing from a group having at least the three following statuses: erasedblock, block containing a valid data, or block containing an invaliddata; and an information about a position in the logical page of datastored in the data block.
 10. The method of claim 1, comprising: beforewriting, in the second nonvolatile memory zone, the address of themetadata page, writing in the temporary information structure a startflag; and after having erased the wear counter of the metadata page,writing a final flag in the temporary information structure.
 11. Adevice, comprising: a processing unit; and at least one nonvolatilememory, communicatively coupled to the processing unit, comprisingelectrically erasable and programmable memory cells, wherein theprocessing unit is configured to receive write or read commands and toexecute commands that cause the following to be performed: defining datapages in a first nonvolatile memory zone; defining in the data pagesprogrammable data blocks; defining in a second nonvolatile memory zone,metadata pages comprising metadata structures associated with the datapages present in the first nonvolatile memory zone and wherein each ofthe data pages is associated with a metadata structure of the metadatapages, each metadata structure including a wear counter containing avalue representative of a number of times that the data page associatedwith the metadata structure has been erased; attributing to eachmetadata page a wear counter containing a value representative of anumber of times that a metadata page to which the wear counter isattributed has been erased; and before erasing a metadata page, writingin the second nonvolatile memory zone a temporary information structurecomprising an address in the second nonvolatile memory zone of themetadata page and a wear counter attributed to the metadata page. 12.The device of claim 11 wherein the processing unit is configured to,after having erased a metadata page, execute commands to cause thefollowing to be performed: reading a wear counter attributed to themetadata page from a temporary information structure including anaddress in the second nonvolatile memory zone of the metadata page andthe wear counter attributed to the metadata page; incrementing the wearcounter read from the temporary information structure; and writing theincremented wear counter in the erased metadata page.
 13. The device ofclaim 11 wherein the processing unit is configured to execute commandsthat cause the following to be performed: writing, in each metadatastructure associated with a data page, an information about a status,valid or invalid, of the data page; and erasing data pages having astatus of invalid as indicated in an associated metadata structure ofthe data page.
 14. The device of claim 11 wherein the processing unit isconfigured to execute commands that cause the following to be performed:invalidating a metadata structure associated with an erased data page;attributing a new metadata structure to the erased data page; andwriting in the new metadata structure an incremented value of a wearcounter present in the invalidated metadata structure.
 15. The device ofclaim 11 wherein the processing unit is configured to execute commandsthat cause the following to be performed: in response to a read commandof other data having a logical address: finding, in the secondnonvolatile memory zone, a metadata structure containing the logicaladdress and associated with valid data; reading, in the metadatastructure found, an address of the other data in the first memory zone;and reading the other data in the first nonvolatile memory zone.
 16. Thedevice of claim 11 wherein the processing unit is configured to executecommands that cause the following to be performed: before writing, inthe second nonvolatile memory zone, the address of a metadata page,writing in the temporary information structure a start flag, and afterhaving erased a wear counter attributed to the metadata page, writing afinal flag in the temporary information structure.
 17. A device,comprising: a processing unit; and at least one nonvolatile memory,communicatively coupled to the processing unit, comprising electricallyerasable and programmable memory cells, wherein the processing unit isconfigured to receive write or read commands and to execute commandsthat cause the following to be performed: defining data pages in a firstnonvolatile memory zone; defining in the data pages programmable datablocks; defining in a second nonvolatile memory zone, metadata pagescomprising metadata structures associated with the data pages present inthe first nonvolatile memory zone and wherein each of the data pages isassociated with a metadata structure of the metadata pages, eachmetadata structure including a wear counter containing a valuerepresentative of a number of times that the data page associated withthe metadata structure has been erased; attributing to each metadatapage a wear counter containing a value representative of a number oftimes that a metadata page to which the wear counter is attributed hasbeen erased; before writing, in the second nonvolatile memory zone, theaddress of a metadata page, writing in the temporary informationstructure a start flag, and after having erased a wear counterattributed to the metadata page, writing a final flag in the temporaryinformation structure.
 18. The device of claim 17 wherein the processingunit is configured to execute commands that cause the following to beperformed: writing, in each metadata structure associated with a datapage, an information about a status, valid or invalid, of the data page;and erasing data pages having a status of invalid as indicated in anassociated metadata structure of the data page.
 19. The device of claim17 wherein the processing unit is configured to execute commands thatcause the following to be performed: invalidating a metadata structureassociated with an erased data page; attributing a new metadatastructure to the erased data page; and writing in the new metadatastructure an incremented value of a wear counter present in theinvalidated metadata structure.
 20. The device of claim 17 wherein theprocessing unit is configured to execute commands that cause thefollowing to be performed: in response to a read command of other datahaving a logical address: finding, in the second nonvolatile memoryzone, a metadata structure containing the logical address and associatedwith valid data; reading, in the metadata structure found, an address ofthe other data in the first memory zone; and reading the other data inthe first nonvolatile memory zone.